# coding: utf-8
from django.db import models
from django.contrib.auth.models import User

class Tag(models.Model):
	tag_name = models.CharField(max_length=100)
	def __str__(self):
		return self.tag_name

class Article(models.Model):
	article_title = models.CharField(max_length=70)
	article_tags = models.ManyToManyField(Tag,blank=True)
	post_time = models.DateTimeField()
	comments_num = models.CharField(max_length=30)
	access_num = models.CharField(max_length=30)
	article_body = models.TextField()
	article_excerpt = models.CharField(max_length=200,blank=True)
	author_name = models.ForeignKey(User)
	def __str__(self):
		return self.article_title